<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>幸运大转盘</title>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="__ADDONSTATIC__/css/bootstrap3/css/bootstrap.min.css">
    {js href='/public/static/layui/layui.js' /} {CSS href="/public/static/layui/css/layui.css" /}
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

    <div class="container" style="width:100%;padding:0px;">
        <div class="rows">
            <!--<a href="{:addonUrl('addRoll')}"><button type="button" class="btn btn-default btn-sm " style="margin-left:15px;margin-bottom:10px;">新建活动</button></a>-->
            <div class="col-md-12 content">
                <div class="table-responsive">
                    <table class="table table-striped">
                        <tr>
                            <th>序号</th>
                            <th>活动名称</th>
                            <th>开始时间</th>
                            <th>结束时间</th>
                            <th>操作</th>
                        </tr>
                        {foreach $list as $k=>$v}
                        <tr>
                            <td>{$v.id}</td>
                            <td>{$v.name}</td>
                            <td>{$v.start_time}</td>
                            <td>{$v.end_time}</td>
                            <td>
                                <a href="{:addonUrl('Rollprize/prize')}?id={$v.id}"><button class="btn btn-default btn-sm">奖品设置</button></a>
                                <a href="{:addonUrl('Rollprize/index')}?roll_id={$v.id}"><button class="btn btn-default btn-sm">中奖名单</button></a>
                                <button data-id="{$v.id}" class="btn btn-default btn-sm oddrs">活动地址</button>
                                <a href="{:addonUrl('index/deleteRoll')}?id={$v.id}"><button class="btn btn-default btn-sm btn-danger">删除</button></a>

                            </td>
                        </tr>
                        {/foreach}
                    </table>
                </div>
                <div align="center">
                    <ul class='pagination'> </ul>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="__ADDONSTATIC__/js/jquery-1.10.2.min.js"></script>
    <script src="__ADDONSTATIC__/js/bootstrap.min.js"></script>
</body>
<script>
    layui.use('layer', function () {
        var layer = layui.layer;
        $(".oddrs").click(function () {
            
            layer.open({
                title: '活动地址'
                , content: `复制地址,到入口配置->连接地址处完成配置</br>{:getHostDomain()}{:addonUrl('index/index')}?roll_id=`+$(this).attr('data-id')
            });
        })

    });

</script>

</html>